//
//  ViewController.m
//  alert
//
//  Created by iD Student on 7/9/13.
//  Copyright (c) 2013 iD Student. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Welcome!" message:@"Enjoy the app!" delegate:self cancelButtonTitle:@"cancel" otherButtonTitles:@"Button1", @"Button2", nil];
    [alert show];
}


- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger) buttonIndex{
    if(buttonIndex == 1)
    {
    label.text=@"Button 1";
    }
    else if(buttonIndex == 2)
    {
    label.text=@"Button 2";
    }
    else if(buttonIndex==0)
    {
    label.text=@"No Button D:";
    }
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
